package com.yudean.esb.dao.sys;

import com.yudean.esb.domain.sys.SysAccessLog;
import com.yudean.esb.mapper.sys.SysAccessLogMapper;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Repository
@Scope("prototype")
public class SysAccessLogDao {
    @Resource
    private SysAccessLogMapper sysAccessLogMapper;

    public boolean batchInsertAccessLog(List<SysAccessLog> sysAccessLogList) {
        if (sysAccessLogList == null || sysAccessLogList.size() < 1) {
            return false;
        }
        sysAccessLogMapper.batchInsertAccessLog(sysAccessLogList);
        return true;
    }

    public List<SysAccessLog> selectAccessLogByAccessTime(Date beginAccessTime, Date endAccessTime) {
        if (beginAccessTime.getTime() < endAccessTime.getTime())
            return null;
        return sysAccessLogMapper.selectAccessLogByAccessTime(beginAccessTime, endAccessTime);

    }


}
